package com.shop.pandian.framework.base.service;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.springframework.dao.DataAccessException;

import com.shop.pandian.framework.base.dao.EntityDAO;
import com.shop.pandian.framework.base.page.BaseQuery;
import com.shop.pandian.framework.base.page.Page;

public interface BaseService<E, PK extends Serializable> {

	public EntityDAO getEntityDAO();

	E getById(PK id) throws DataAccessException;

	List<E> findAll() throws DataAccessException;

	List<E> findByProperty(String[] property, Object[] value) throws DataAccessException;

	List<E> findByHql(String hql, Object[] values) throws DataAccessException;

	void saveOrUpdate(E entity) throws DataAccessException;

	void save(E entity) throws DataAccessException;

	void removeById(PK id) throws DataAccessException;

	void removeAll(Collection c) throws DataAccessException;

	void update(E entity) throws DataAccessException;

	Page findPage(BaseQuery query);
}
